<?php
@header("Content-Type:text/html;charset=utf-8");
@include_once("conn.php");

if(!isset($_GET['email'])){
    $obj=array();
    $obj["status"] = false;
    $obj['msg'] = "请输入完整的参数";
    $json = json_encode($obj);
    exit($json);
}

$email = $_GET["email"];

$sql = "select * from `userinfos` where email = '$email'";

$result = mysqli_query($conn,$sql);

$obj = array();
if($result){
    $item = mysqli_fetch_assoc($result);
    if(!$item){
        $obj["status"] = true;
        $obj["msg"] = '可以使用的邮箱';

    }else{
        $obj["status"] = false;
        $obj["msg"] = '该邮箱已注册';
    }
}else{
    $obj["status"] = false;
    $obj["msg"] = "sql语句有误";
    $obj["sql"] = $sql;
}
echo json_encode($obj);

?>